package cn.itcast.erp.controller;

import cn.itcast.erp.annotation.CheckPower;
import cn.itcast.erp.entity.Emp;
import cn.itcast.erp.entity.Storealert;
import cn.itcast.erp.entity.utils.AjaxResult;
import cn.itcast.erp.service.StorealertService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;

/**
 * 库存预警邮件Controller类
 */

@Controller
@RequestMapping("/storealert")
public class StorealertController {

    @Resource
    private StorealertService storealertService;

    @CheckPower("库存预警")
    @ResponseBody
    @RequestMapping("sendStorealerMail")
    public AjaxResult sendStorealerMail() {
        AjaxResult ar = new AjaxResult();
        String s = storealertService.sendStorealerMail();
        ar.setMsg(s);
        return ar;
    }
}

